import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../login.vue'
import Order from '../views/manager/order.vue'
import User from '../views/manager/user.vue'
import Index from '../views/manager/index.vue'
import RealMan from '../views/manager/realMan.vue'
import Money from '../views/manager/money.vue'
import OrderDetails from '../views/manager/orderDetails.vue'
import CashOut from '../views/manager/cashOut.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    redirect:'/login'
  },
  {
    path: '/manager',
    name: 'manager',
    component: Home,
    children:[{
      path:'index',
      component:Index
    },{
      path:'order',
      component:Order
    },{
      path:'user',
      component:User
    },{
      path:'realMan',
      component:RealMan
    },{
      path:'money',
      component:Money
    },{
      path:'orderDetails',
      component:OrderDetails
    },{
      path:'cashOut',
      component:CashOut
    }]
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
  }
  
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
